Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Rust crate ratatui to 0.28.1 #6677

Merged
merged 1 commit into from
Oct 14, 2024
Merged

Update Rust crate ratatui to 0.28.1 #6677

merged 1 commit into from
Oct 14, 2024

Conversation

oxide-renovate[bot]
Copy link
Contributor

@oxide-renovate oxide-renovate bot commented Sep 26, 2024

This PR contains the following updates:

Package Type Update Change
ratatui (source) workspace.dependencies patch 0.28.0 -> 0.28.1

Release Notes

ratatui/ratatui (ratatui)

v0.28.1

Compare Source

Features
  • ed51c4b (terminal) Add ratatui::init() and restore() methods by @​joshka in #​1289

    These are simple opinionated methods for creating a terminal that is
    useful to use in most apps. The new init method creates a crossterm
    backend writing to stdout, enables raw mode, enters the alternate
    screen, and sets a panic handler that restores the terminal on panic.

    A minimal hello world now looks a bit like:

    use ratatui::{
        crossterm::event::{self, Event},
        text::Text,
        Frame,
    };
    
    fn main() {
        let mut terminal = ratatui::init();
        loop {
            terminal
                .draw(|frame: &mut Frame| frame.render_widget(Text::raw("Hello World!"), frame.area()))
                .expect("Failed to draw");
            if matches!(event::read().expect("failed to read event"), Event::Key(_)) {
                break;
            }
        }
        ratatui::restore();
    }

    A type alias DefaultTerminal is added to represent this terminal
    type and to simplify any cases where applications need to pass this
    terminal around. It is equivalent to:
    Terminal<CrosstermBackend<Stdout>>

    We also added ratatui::try_init() and try_restore(), for situations
    where you might want to handle initialization errors yourself instead
    of letting the panic handler fire and cleanup. Simple Apps should
    prefer the init and restore functions over these functions.

    Corresponding functions to allow passing a TerminalOptions with
    a Viewport (e.g. inline, fixed) are also available
    (init_with_options,
    and try_init_with_options).

    The existing code to create a backend and terminal will remain and
    is not deprecated by this approach. This just provides a simple one
    line initialization using the common options.


Bug Fixes
  • aed60b9 (terminal) Terminal::insert_before would crash when called while the viewport filled the screen by @​nfachan in #​1329

    Reimplement Terminal::insert_before. The previous implementation would
    insert the new lines in chunks into the area between the top of the
    screen and the top of the (new) viewport. If the viewport filled the
    screen, there would be no area in which to insert lines, and the
    function would crash.

    The new implementation uses as much of the screen as it needs to, all
    the way up to using the whole screen.

    This commit:

    • adds a scrollback buffer to the TestBackend so that tests can
      inspect and assert the state of the scrollback buffer in addition to the
      screen
    • adds functions to TestBackend to assert the state of the scrollback
    • adds and updates TestBackend tests to test the behavior of the
      scrollback and the new asserting functions
    • reimplements Terminal::insert_before, including adding two new
      helper functions Terminal::draw_lines and Terminal::scroll_up.
    • updates the documentation for Terminal::insert_before to clarify
      some of the edge cases
    • updates terminal tests to assert the state of the scrollback buffer
    • adds a new test for the condition that causes the bug
    • adds a conversion constructor Cell::from(char)

    Fixes:https://github.com/ratatui/ratatui/issues/999

  • fdd5d8c (text) Remove trailing newline from single-line Display trait impl by @​LucasPickering in #​1320

  • 2fb0b8a (uncategorized) Fix u16 overflow in Terminal::insert_before. by @​nfachan in #​1323

    If the amount of characters in the screen above the viewport was greater
    than u16::MAX, a multiplication would overflow. The multiply was used to
    compute the maximum chunk size. The fix is to just do the multiplication
    as a usize and also do the subsequent division as a usize.

    There is currently another outstanding issue that limits the amount of
    characters that can be inserted when calling Terminal::insert_before to
    u16::MAX. However, this bug can still occur even if the viewport and the
    amount of characters being inserted are both less than u16::MAX, since
    it's dependant on how large the screen is above the viewport.

    Fixes #​1322

Documentation
Testing
  • 0d5f3c0 (uncategorized) Avoid unneeded allocations in assertions by @​mo8it in #​1335

    A vector can be compared to an array.

Miscellaneous Tasks
  • 65da535 (ci) Update release strategy by @​orhun in #​1337

    closes #​1232

    Now we can trigger point releases by pushing a tag (follow the
    instructions in RELEASE.md). This will create a release with generated
    changelog.

    There is still a lack of automation (e.g. updating CHANGELOG.md), but
    this PR is a good start towards improving that.

  • 57d8b74 (ci) Use cargo-docs-rs to lint docs by @​joshka in #​1318

  • 8b624f5 (maintainers) Remove EdJoPaTo by @​EdJoPaTo in #​1314

  • 23516bc (uncategorized) Rename ratatui-org to ratatui by @​joshka in #​1334

    All urls updated to point at https://github.com/ratatui

    To update your repository remotes, you can run the following commands:

    git remote set-url origin https://github.com/ratatui/ratatui
Build
  • 0256269 (uncategorized) Simplify Windows build by @​joshka in #​1317

    Termion is not supported on Windows, so we need to avoid building it.

    Adds a conditional dependency to the Cargo.toml file to only include
    termion when the target is not Windows. This allows contributors to
    build using the --all-features flag on Windows rather than needing
    to specify the features individually.

New Contributors

Full Changelog: ratatui/ratatui@v0.28.0...v0.28.1


Configuration

📅 Schedule: Branch creation - "after 8pm,before 6am" in timezone America/Los_Angeles, Automerge - "after 8pm,before 6am" in timezone America/Los_Angeles.

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

@oxide-renovate oxide-renovate bot added the dependencies Pull requests that update a dependency file label Sep 26, 2024
@oxide-renovate oxide-renovate bot force-pushed the renovate/ratatui-0.x branch 3 times, most recently from 51b11e8 to dc8e920 Compare October 2, 2024 03:10
@oxide-renovate oxide-renovate bot force-pushed the renovate/ratatui-0.x branch 2 times, most recently from e9a50f0 to 171ec2e Compare October 11, 2024 03:06
@sunshowers sunshowers merged commit 6f55a7a into main Oct 14, 2024
18 checks passed
@sunshowers sunshowers deleted the renovate/ratatui-0.x branch October 14, 2024 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant